<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="__UI__/css/bs3/dpl.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/bs3/bui.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
button {
	margin-right:20px;
}
</style>
</head>
<body>
<div class="demo-content" style="margin-top:1%;">
    <div class="row" style="margin-left:10px;">
        <form id="J_Form" action="{:U('Member/add')}" class="form-horizontal registerform" method="post" enctype="multipart/form-data">
        	<div id="tab" style="margin-left:1%; padding-bottom:20px; padding-top:20px;"></div>
            <div id="panel" class="" style="padding:10px;">
				<input name="status" type="hidden" value="1">
                <input name="uid" type="hidden" value="{:session('gid')}">
                <input name="company" type="hidden" value="{:session('memberinfo.company')}">
                <div class="control-group">
					<label class="control-label"><s>*</s>用户昵称</label>
					<div class="controls">
						<input type="text" name="nickname" id="nickname" class="input-large" datatype="*" nullmsg="请输入用户昵称！" ajaxurl="{:U('Member/nickname')}" sucmsg="此用户昵称可注册" data-tip="{text:'请输入用户昵称'}" />
					</div>
				</div>
                <div class="control-group">
					<label class="control-label"><s>*</s>用户名称</label>
					<div class="controls">
						<input type="text" name="username" id="username" class="input-large" datatype="*" nullmsg="请输入用户名称！" ajaxurl="{:U('Member/checkname')}" sucmsg="此用户名称可注册" data-tip="{text:'请输入用户名称'}" />
					</div>
				</div>
            	<div class="control-group">
					<label class="control-label"><s>*</s>部门名称</label>
					<div class="controls">
						<input type="text" name="department" id="department" class="input-large" datatype="*" nullmsg="请输入部门名称！" data-tip="{text:'请输入部门名称'}" />
					</div>
				</div>
                
                <div class="control-group">
					<label class="control-label"><s>*</s>用户密码</label>
					<div class="controls">
						<input type="password" name="password" id="password" class="input-large" datatype="*6-16" nullmsg="请输入用户密码！" errormsg="密码范围在6~16位之间！" data-tip="{text:'请输入用户密码'}" />
					</div>
				</div>
                <div class="control-group">
					<label class="control-label"><s>*</s>确认密码</label>
					<div class="controls">
						<input type="password" name="repassword" class="input-large" datatype="*" recheck="password" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！"  data-tip="{text:'请再次输入用户密码'}" />
					</div>
				</div>
                <div class="control-group">
					<label class="control-label"><s>*</s>用户组群</label>
					<div class="controls">
						<label class="control-label checkbox" style="text-align:left;"><input type="checkbox" name="gid" value="1">管理员账号</label>
					</div>
				</div>
                <div class="row actions-bar">
                	<span id="msgdemo2"></span>
                    <div class="form-actions span13 offset3">
                        <button type="submit" class="button button-primary">保存</button>
                        <button type="reset" class="button">重置</button>
                        <button type="button" class="button button-info" name="backid" id="backid">返回</button>
                    </div>
            	</div>           
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="__UI__/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="__UI__/js/bui.js"></script>
<script type="text/javascript" src="__UI__/js/config.js"></script>
<script type="text/javascript" src="__UI__/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	$(function () {       
		$('#backid').click(function(){
			top.topManager.openPage({
				id:'member_index',
				title:'用户管理',
				href:'{:U("Member/index")}',
				isClose:true,
				reload:true,
			});
		 });
    });
	top.topManager.closePage('member_index');
	top.topManager.closePage('member_edit');
	top.topManager.closePage('member_repwd');
    BUI.use(['bui/tab','bui/mask'],function(Tab){
        var tab = new Tab.TabPanel({
            render:'#tab',
            elCls:'nav-tabs',
            panelContainer:'#panel',
            autoRender:true,
            children:[
                {title:'基本信息',value:'1',selected:true},
            ]
        });
    });
    BUI.use('bui/form', function (Form) {
        new Form.Form({
            srcNode:'#J_Form'
        }).render();
    });

	$(function(){
		$(".registerform").Validform({
			tiptype:function(msg,o,cssctl){
				var objtip=$("#msgdemo2");
				cssctl(objtip,o.type);
				objtip.text(msg);
			},
			ajaxPost:true,
			callback:function(data){
				if(data.status == 'y'){
					top.topManager.openPage({
						id:'member_index',
						title:'用户管理',
						href:'{:U("Member/index")}',
						isClose:true,
						reload:true,
					});
				}
			},
		});
	})
</script>
</body>
</html>